<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/commons/taglibs.jsp"%>
<%@ include file="/static/commons/meta.jsp"%>
<%@ include file="/static/commons/ecside.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>${title}</title>
		<script type="text/javascript" src="${ctx}/static/scripts/check_all.js"></script>
		<script type="text/javascript">
			function init(){
				parent.waiting_stop();
			}
			function changeStyle(obj){
			  	ec_showContent(obj,"700px");
			}
		</script>
	</head>
	<body onload="init()">
			<ec:table items="list" var="v" title="" width="100%"
				retrieveRowsCallback="process" filterRowsCallback="process"
				maxRowsExported="1000" pageSizeList="15,30,50,all" useAjax="false"
				rowsDisplayed="15" sortable="false" filterable="false"
				resizeColWidth="true" classic="true" minHeight="200"
				excludeParameters="checkAll,ID_,id"
				toolbarContent="extend status|pagejump|navigation|pagesize|refresh"
				action="${ctx}/orderBilling/list">
				<ec:row style="text-align: center;">
					<ec:column property="user_id_"
					title="<input type='checkbox' name='checkAll' onclick='check_all(this.form,this.form.id)'>"
					style="text-align:center;width:34px;" sortable="false">
					<input type='checkbox' value='${v.billing_id}' name='id' id="id" onclick="check_item(this.form,this.form.id)" ></input>
				    </ec:column>
					<ec:column property="serial" title="序号" style="text-align:center;width:30px;">${GLOBALROWCOUNT}</ec:column>
					<ec:column property="billing_id" title="订单编号" ><a href="javascript:void(0)" onclick="parent.view('${v.billing_id }',1)">${v.order_id}</a></ec:column>					
					<ec:column property="user_name" title="申请人">${v.user_name}</ec:column>
					<ec:column property="salesman" title="业务员">${v.salesman}</ec:column>
					<ec:column property="cust_name" title="用户单位">${v.cust_name}</ec:column>
					<ec:column property="billing_date" title="申请日期" ><fmt:formatDate value="${v.billing_date}" pattern="yyyy-MM-dd" /> </ec:column>
					<ec:column property="total_price" title="总金额" >${v.total_price}</ec:column>					
					<ec:column property="status" title="开票操作" >					 
						<c:choose>
						    <c:when test="${v.status eq 1}">
						        <a href="javascript:void(0)" onclick="parent.view('${v.billing_id }',1)">开票</a>
						    </c:when>						   
						    <c:otherwise>
						        <a href="javascript:void(0)" style="color: #09bd49;" onclick="parent.view('${v.billing_id }',2)">已开票</a>
						    </c:otherwise>
						</c:choose>
                    </ec:column>
					<ec:column property="status" title="取票操作">
					    <c:choose>
					        <c:when test="${v.status eq 1}">
						        <a href="javascript:void(0)"></a>
						    </c:when>	
						    <c:when test="${v.status eq 2}">
						        <a href="javascript:void(0)" onclick="parent.openTackTickets('${v.billing_id }',1)">取票</a>
						    </c:when>						   
						    <c:otherwise>
						        <a href="javascript:void(0)" style="color: #09bd49;" onclick="parent.openTackTickets('${v.billing_id }',2)">已取票</a>
						    </c:otherwise>
						</c:choose>
					</ec:column>
					<ec:column property="status" title="回款操作" style="text-align:center;">
						<c:choose>
					        <c:when test="${v.status eq 1||v.status eq 2}">
						        <a href="javascript:void(0)"></a>
						    </c:when>	
						    <c:when test="${v.status eq 3||v.status eq 4}">
						        <a href="javascript:void(0)" onclick="parent.showPayBack('${v.billing_id }',1)">回款</a>
						    </c:when>						   
						    <c:otherwise>
						        <a href="javascript:void(0)" style="color: #09bd49;" onclick="parent.showPayBack('${v.billing_id }',2)">已回款</a>
                            </c:otherwise>
						</c:choose>
					</ec:column>					
				</ec:row>
			</ec:table>
	</body>
</html>